package com.sam.im.heiqun.utils;

import android.support.annotation.Nullable;

import com.yuyh.library.utils.data.safe.MD5;

/**
 * Created by zhangqiang on 2018/6/26.
 */
public class StringUtils {

    public static boolean isEmpty(CharSequence charSequence){

        return charSequence == null || charSequence.length() <= 0;
    }

    @Nullable
    public static String makeFileName(String fileUrl) {

        if(isEmpty(fileUrl)){
            return null;
        }

        int index = fileUrl.lastIndexOf(".");
        if(index < 0){
            return null;
        }
        return MD5.MD516(fileUrl) + fileUrl.substring(index);
    }
}
